﻿using System;

namespace 第三周
{
    class Program
    {
        static void Main(string[] args)
        {
            Bird[] birds = {
                new Bird(),
                new Eagle() 
            };

            foreach (Bird bird in birds)
            {
                bird.Eat();
            }
            Console.ReadKey();
        }

        public class Bird
        {
            public virtual void Eat()
            {
                Console.WriteLine("鸟");
            }
        }



        public class Eagle : Bird
        {
            public override void Eat()
            {
                Console.WriteLine("鹰");
            }
        }
    }
}
